
<template>
  <div class="menu">
    <el-menu
      default-active="1-1"
      :router="true"
      class="el-menu-vertical-demo"
      :collapse="userStore.isClose"
      @open="handleOpen"
      @close="handleClose"
    >
    <houduanMenus  :menu="menu"></houduanMenus>
      <!-- <el-sub-menu v-if="item.children.length != 0" index="1">
        <template #title>
          <el-icon><location /></el-icon>
          <span>{{ item.title }}</span>
        </template> 
          <el-menu-item index="1-1">item one</el-menu-item>
        <el-sub-menu index="1-4">
          <template #title><span>item four</span></template>
          <el-menu-item index="1-4-1">item one</el-menu-item>
        </el-sub-menu>
      </el-sub-menu>
      <el-menu-item v-else index="2">
        <el-icon><icon-menu /></el-icon>
        <template #title>{{ item.title }}</template>
      </el-menu-item> -->
    </el-menu>
    <!-- <el-menu
    class="boss"
      :router="true"
      :collapse="$store.state.iscollapse"
      :default-openeds="['1', '3']"
    >
      <Menus :menulist="$store.state.menulist"></Menus>
    </el-menu> -->
  </div>
  </template>
  
  <script lang="ts" setup>
 import { useIsClose } from '@/composables/userStore'  
  const userStore = useIsClose()
    

  const props = defineProps(['menu']) 
  const menu = ref(props.menu)
  console.log('锐',menu.value);
  
  import { ref } from 'vue'
  import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
  } from '@element-plus/icons-vue'
  
  const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
  const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
  </script>
  
  <style>
  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }
  </style>
